package com.tianshuo.controller;

import com.amos.log.configure.service.LogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.concurrent.TimeUnit;

/**
 * @ClassName : UserController
 * @Description : 测试的用户controller
 * @Author : tianshuo
 * @Date: 2020-10-31 10:23
 */
@Controller
public class UserController {

	@Autowired
	StringRedisTemplate stringRedisTemplate;


	@ResponseBody
	@RequestMapping("/show")
	public String show() {
		System.out.println("show");
		return "show";
	}
	@ResponseBody
	@RequestMapping("/save")
	public String save(String key ,String value) {
		stringRedisTemplate.opsForValue().set(key,value,3000, TimeUnit.SECONDS);
		return "done";
	}

	@RequestMapping("/log")
	@ResponseBody
	public String log() {
		return "log";
	}

}

